import './assets/main.css'

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

// 01: 引入下载好的pinia
import { createPinia } from 'pinia';
// 引入pinia 持久化插件
import { createPersistedState } from 'pinia-persistedstate-plugin'
// 02: 创建pinia 对象
const pinia = createPinia();
// 调用持久化插件
pinia.use(createPersistedState())
// console.log('pinia', pinia);



const app = createApp(App)

// 自定义全局指令
// app.directive('font30', {
//     mounted(el, binding) {
//         el.style.fontSize = binding.value
//     }
// })

//自定义指令简写:
app.directive('font30', (el, binding) => {
    el.style.fontSize = binding.value
})

//03: 挂载pinia仓库到根实例上
app.use(pinia)
app.use(router)

app.mount('#app')
